<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/security.tld" prefix="s" %>
<html:form action="/saveRecurrentCharges">
	<table width="<bean:write name="totalSize"/>" align="center" border="0">
		<tr>
			<td style="width: 100%" align="center">
				<table width="100%" align="center"  border="0" cellspacing="1" bgcolor="#CCCCC0">
					<%int int_i = 0; %>
					<logic:present name="RECURRENT_CHARGES_GROUP_VIEW">
						<logic:iterate name="RECURRENT_CHARGES_GROUP_VIEW" id="plants" indexId="externalCount">
							<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
								<td width="147">
									<table width="100%" align="center" border="0" cellspacing="0" bgcolor="#CCCCC0">
										<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
											<td align="left" rowspan="<%=((com.cpi.cornpp.recurrentcharges.view.RecurrentChargesGroupView)plants).getRecurrentChargesViews().size()+1%>" width="25%">
												<bean:write name="plants" property="plantCode"/>
											</td>
											<td width="25%" class="etiqueta_bold_center">Trans.</td>
											<td width="24%" class="etiqueta_bold_center">Cost.</td>
											<td width="22%" class="etiqueta_bold_center">Mon.</td>
											<td width="4%" class="etiqueta_bold_center">&nbsp;</td>
										</tr>
										<logic:iterate name="plants" property="recurrentChargesViews" id="charges" indexId="chargesCount">
											<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
												<td height="23" align="left"><bean:write name="charges" property="transportCode"/></td>
												<td height="23" align="left"><bean:write name="charges" property="costElementCode"/></td>
												<td height="23" align="left"><bean:write name="charges" property="currencyCode"/></td>
												<td height="23" align="center">
													<s:entidad nombreCortoEnt="DELETE" permiso="ADMINISTRACION" nombreCortoMod="PROC" nombreCortoSub="VERCMR">				
														<a href="#>" onclick="if(confirmDelete('<bean:write name="charges" property="transportCode"/> -- <bean:write name="charges" property="costElementCode"/>'))location.href='deleteRecurrentCharges.do?recurrentChargesAddView.plantId=<bean:write name="plants" property="plantId"/>&recurrentChargesAddView.transportId=<bean:write name="charges" property="transportId"/>&recurrentChargesAddView.costElementId=<bean:write name="charges" property="costElementId"/>';">
															<img alt="" src="images/eliminar.jpg" width="15" height="15" border="0">
														</a>
													</s:entidad>
												</td>
											</tr>
										</logic:iterate>
									</table>
								</td>
								<td valign="bottom">
									<logic:iterate name="plants" property="recurrentChargesViews" id="charges" indexId="chargesCount">
										<table width="100%" align="center" border="0" cellspacing="0" bgcolor="#CCCCC0">
											<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
												<logic:iterate name="charges" property="recurrentChargesAmountViews" id="amountCharges" indexId="amountChargesCount">
												    <td width="150" height="22">
														<input type="text" name="recurrentChargesAmountViews[<%=int_i++%>].amount" value="<bean:write name="amountCharges" property="amount"/>" size="8"  class="columnanumero" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,4,false);"/>
													</td>
												</logic:iterate>
											</tr>
										</table>
									</logic:iterate>
								</td>
							</tr>
						</logic:iterate>
					</logic:present>
					<tr>
						<td align="left" colspan="<bean:write name="totalPeriods"/>" height="30" class="etiqueta_campo">
							&nbsp;&nbsp;&nbsp;&nbsp;
							<s:entidad nombreCortoEnt="NEW" permiso="ADMINISTRACION" nombreCortoMod="PROC" nombreCortoSub="VERCMR">
								<html:submit styleClass="boton"><bean:message key="label.common.save"/></html:submit>
							</s:entidad>
							<html:button property="cancel" onclick="location.href = 'showVersionDetail.do'" styleClass="boton"><bean:message key="label.common.cancel"/></html:button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</html:form>